﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace linkDATABASE.留言查询
{
    public partial class querymessages : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            string name = TextBox1.Text;
            if (!name.Equals(""))
            {
                SqlDataSource1.SelectCommand = "SELECT [ID],[Name], [Detail], [Time] ,[Back] FROM [gusetbookinfo] where Name = '" + name + "'";
                SqlDataSource1.DataBind();
            }
            else
            {
                SqlDataSource1.SelectCommand = "SELECT [ID],[Name], [Detail], [Time] ,[Back] FROM [gusetbookinfo] ";
                SqlDataSource1.DataBind();
            }
            
        }

    }
}